<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>console.log内存泄漏问题</title>
  <style>
    .block {
      display: flex;
      margin: 100px auto 0;
      width: 400px;
    }
  </style>
</head>

<body>
  <div class="block">
    <button id="print-log">打印log</button>
  </div>
</body>
<script>
  const btnPrint = document.getElementById('print-log');
  btnPrint.addEventListener('click', () => {
    const arr = new Array(1000000);
    arr.fill('中国');
    console.log(arr);
  })
</script>

</html>